import Home from '@/views/Home.vue'
import UserLogin from '@/views/Login.vue'
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs'
import PageNotFound from '@/views/PageNotFound.vue'
import SpuManage from '@/views/product/SpuManage.vue'
import BrandMange from '@/views/product/BrandMange.vue'
import AttrManage from '@/views/product/AttrManage.vue'
import SkuManage from '@/views/product/SkuManage.vue'
import UserManage from '@/views/acl/UserManage.vue'
import RoleManage from '@/views/acl/RoleManage.vue'
import MenuManage from '@/views/acl/MenuManage.vue'
import AddSpuManager from '@/views/product/AddSpuManager.vue'
import Purchase from '@/views/product/PurchaseManager.vue'
import EditPurchase from "@/views/purchase/EditPurchase.vue";
import AddSpuManager2 from '@/views/product/AddSpuManager2.vue'
import AddSpuManager3 from '@/views/product/AddSpuManager3.vue'

export const routes = [
  {
    path: '/login',
    name: 'login',
    component: UserLogin
  },
  {
    path: '/404',
    name: '404',
    component: PageNotFound
  },
  {
    path: '/',
    name: 'home',
    component: Home,
    meta: {},
    children: [
      {
        path: '/product',
        name: 'product',
        redirect: '/product/brand',
        children: [
          {
            path: '/product/brand',
            name: 'brand',
            component: BrandMange
          },
          {
            path: '/product/attr',
            name: 'attr',
            component: AttrManage
          },
          {
            path: '/product/spu',
            name: 'spu',
            component: SpuManage
          },
          {
            path: '/product/sku',
            name: 'sku',
            component: SkuManage
          },
          {
            path: '/product/addSpu',
            name: 'addSpu',
            component: AddSpuManager,
          },
          {
            path: '/product/addSpu2',
            name: 'addSpu2',
            component: AddSpuManager2,
          },
          {
            path: '/product/addSpu3',
            name: 'addSpu3',
            component: AddSpuManager3,
          },
          {
            path: '/product/purchase',
            name: 'purchase',
            component: Purchase
          },
          {
            path: '/product/purchase/edit',
            name: 'edit',
            component: EditPurchase
          }
        ]
      },
      {
        path: '/acl',
        name: 'acl',
        redirect: '/acl/user',
        children: [
          {
            path: '/acl/user',
            name: 'user',
            component: UserManage
          },
          {
            path: '/acl/role',
            name: 'role',
            component: RoleManage
          },
          {
            path: '/acl/menu',
            name: 'menu',
            component: MenuManage
          }
        ]
      }
    ]
  }
]
